# Copyright 2021 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob")
load("//build_tools/bazel:iree_lit_test.bzl", "iree_lit_test_suite")

package(
    features = ["layering_check"],
    licenses = ["notice"],  # Apache 2.0
)

iree_lit_test_suite(
    name = "lit",
    srcs = enforce_glob(
        [
            "annotate_affinities.mlir",
            "annotate_constant_transient_size.mlir",
            "annotate_dispatch_arguments.mlir",
            "annotate_dispatch_assumptions.mlir",
            "automatic_reference_counting.mlir",
            "clone_to_consumers.mlir",
            "convert_to_stream.mlir",
            "dump_statistics.mlir",
            "elide_async_copies.mlir",
            "elide_async_copies_scf.mlir",
            "elide_async_copies_tensor_import_consume.mlir",
            "elide_async_copies_topology.mlir",
            "elide_materialized_copies.mlir",
            "elide_timepoints_coverage.mlir",
            "elide_timepoints_fold.mlir",
            "elide_timepoints_immediate.mlir",
            "elide_timepoints_scf.mlir",
            "emplace_allocations.mlir",
            "emplace_transients.mlir",
            "emplace_transients_scf.mlir",
            "encode_device_tensors.mlir",
            "encode_device_tensors_encoding.mlir",
            "encode_device_tensors_packing.mlir",
            "encode_host_tensors.mlir",
            "encode_host_tensors_encoding.mlir",
            "encode_host_tensors_packing.mlir",
            "encode_host_tensors_packing_i1_experimental_clopt.mlir",
            "fold_globals.mlir",
            "fold_uniform_operands.mlir",
            "fuse_dispatch_bindings.mlir",
            "fuse_dispatch_bindings_noalias.mlir",
            "layout_slices.mlir",
            "materialize_builtins.mlir",
            "materialize_copy_on_write.mlir",
            "materialize_encodings.mlir",
            "materialize_transient_size_queries.mlir",
            "pack_constants.mlir",
            "pack_dispatch_operands.mlir",
            "propagate_subviews.mlir",
            "propagate_timepoints.mlir",
            "propagate_timepoints_scf.mlir",
            "refine_usage.mlir",
            "reuse_allocations.mlir",
            "schedule_allocation.mlir",
            "schedule_concurrency.mlir",
            "schedule_execution.mlir",
            "schedule_execution_scf.mlir",
            "schedule_execution_timeline_aware.mlir",
            "specialize_dispatches.mlir",
            "specialize_encodings.mlir",
            "sync_initializers.mlir",
            "verify_affinities.mlir",
            "verify_async_access_ranges.mlir",
        ],
        include = ["*.mlir"],
    ),
    cfg = "//compiler:lit.cfg.py",
    tools = [
        "//tools:iree-opt",
        "@llvm-project//llvm:FileCheck",
    ],
)
